#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
using namespace std;
const int maxn = 100;

long long gcd( long long A, long long B )
{
    while ( B )
    {
        long long C = A % B;
        A = B;
        B = C;
    }
    return A;
}

long long product_mod( long long A, long long B, long long C )
{
    long long R = 0, D = A;
    while ( B )
    {
        if ( B & 1 )
        {
            R = ( R + D );
            if ( R > C ) R -= C;
        }
        D += D;
        if ( D > C ) D -= C;
        B >>= 1;
    }
    return R;
}

long long power_mod( long long A, long long B, long long C )
{
    long long R = 1, D = A;
    while ( B )
    {
        if ( B & 1 ) R = product_mod( R, D, C );
        D = product_mod( D, D, C );
        B >>= 1;
    }
    return R;
}

int pri[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };

bool Miller_Rabin( long long n )
{
    if ( n < 2 ) return false;
    if ( n==2 ) return true;
    if ( !( n & 1 ) ) return false;
    long long k = 0, i, j, m, a;
    m = n - 1;
    while ( !( m & 1 ) ) m = ( m >> 1 ), k++;
    for ( i = 0; i < 10; i++ )
    {
        if ( pri[ i ] >= n ) return true;
        a = power_mod( pri[ i ], m, n );
        if ( a == 1 ) continue;
        for ( j = 0; j < k; j++ )
        {
            if ( a == n - 1 ) break;
            a = product_mod( a, a, n );
        }
        if ( j == k ) return false;
    }
    return true;
}

long long pollard_rho( long long C, long long N )
{
    long long I, X, Y, K, D;
    I = 1;
    X = Y = rand( ) % N;
    K = 2;
    do{
        I++;
        D = gcd( N + Y - X, N );
        if ( D > 1 && D < N ) return D;
        if ( I == K ) Y = X, K <<= 1;
        X = ( product_mod( X, X, N ) + N - C ) % N;
    } while ( Y != X );
    return N;
}

long long fac[ maxn ];
int fn;

void rho( long long N )
{
    if ( Miller_Rabin( N ) )
    {
        fac[ fn++ ] = N;
        return ;
    }
    long long T = N;
    while ( T >= N ) T = pollard_rho( rand( ) % ( N - 1 ) + 1, N );
    rho( T );
    rho( N / T );
}

int main( )
{
    int t, i, cnt;
    long long n, ans = 0, p;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%I64d", &n);
        fn = 0;
        rho( n );
        sort( fac, fac + fn );
        ans = 0;
        cnt = 1;
        p = fac[ 0 ];
        for ( i = 1; i < fn; i++ )
            if ( fac[ i ] != fac[ i - 1 ] )
            {
                ans += p;
                cnt++;
                p = fac[ i ];
            }
            else
                p *= fac[ i ];
        if ( cnt == 1 )
            printf("%d %I64d\n", cnt, n / fac[ 0 ]);
        else
        {
            ans += p;
            printf("%d %I64d\n", cnt, ans);
        }
    }
    return 0;
}
